    <link href="__ROOT__/static/assets/css/style.css" rel="stylesheet" type="text/css"/>
    <style>
        .Service-box{text-align: center;}
        .p{color: turquoise;}
        #pay-success{display: none;}
    </style>
{php}
{//var_dump($vo);}
{/php}
        <!-- 可删除 -->
        <div class="Service-box think-box-shadow">
            <div class="clearfix">
            <!--    <form class="form" method="POST" action="{:url('pay/pay')}" autocomplete="off" enctype="multipart/form-data"> -->
                    <form id="pay-form" class="form" method="POST" action="{:request()->url()}" autocomplete="off" enctype="multipart/form-data">
            <!--    <a href="javascript:;" class="Service-item" >
                    <div class="item-image">
                        <img src="__ROOT__/static/assets/img/images/icon-tag001.png" alt="">
                    </div>
                    <h3 class="item-title">电脑网站支付</h3>
                    <div class="item-text">用户在商家网站上完成付款</div>
                    函信息</button>    
                    <button class="item-link" type="submit" id="sub" name="sub" data-action='{:url("pay/pay")}'>我要接入</button>

                </a> -->
                <!-- <button data-modal='{:url("add")}' data-title="添加邀请函信息" class='layui-btn layui-btn-sm layui-btn-primary'>添加邀请</button> -->
                <span style="display: block;">微信支付</span>
                <h2 class="title">{$vo.money}元</h2>
                <span style="display: block;">{$vo.frequency}积分</span>
                <img alt='扫码支付' src="{:url('qrcodeUrl')}?data={$qrCode_url}" style="width: 220px;height: 220px;"/><br />
                <h5 class="">请打开手机微信扫码支付</h5>
<!--                 <a href="{:url('admin/index/index')}" class="p">支付完成后，请点击此处返回系统首页</a> -->
                <!-- <img alt="模式二扫码支付" src="../pay.php?data=<?php echo urlencode($qrCode_url);?>" style="width:150px;height:150px;"/> -->
                </form>
                
                <div class="pay-status" id="pay-success">

                    <i class="layui-icon" style="font-size: 120px; color: #04BE02;">&#x1005;</i>  
                    <h2>支付成功</h2>
                    <a data-open="{:url('personal/order/index')}?spm=m-199-236-238" class="pay-details-a">查看订单详情</a>
                </div>

              <!--  <a href="javascript:;" class="Service-item">
                    <div class="item-image">
                        <img src="__ROOT__/static/assets/img/images/icon-tag002.png" alt="">
                    </div>
                    <h3 class="item-title">手机网站支付</h3>
                    <div class="item-text">用户在商家手机网站进行付款</div>
                    <span class="item-link">我要接入</span>
                </a>
                <a href="javascript:;" class="Service-item">
                    <div class="item-image">
                        <img src="__ROOT__/static/assets/img/images/icon-tag003.png" alt="">
                    </div>
                    <h3 class="item-title">APP支付</h3>
                    <div class="item-text">用户在商家app内进行付款</div>
                    <span class="item-link">我要接入</span>
                </a>
                <a href="javascript:;" class="Service-item">
                    <div class="item-image">
                        <img src="__ROOT__/static/assets/img/images/icon-tag004.png" alt="">
                    </div>
                    <h3 class="item-title">当面付</h3>
                    <div class="item-text">只需扫描用户的付款码，或用户扫描商家的二维码完成付款</div>
                    <span class="item-link">我要接入</span>
                </a>
                <a href="javascript:;" class="Service-item">
                    <div class="item-image">
                        <img src="__ROOT__/static/assets/img/images/icon-tag005.png" alt="">
                    </div>
                    <h3 class="item-title">收钱码</h3>
                    <div class="item-text">支付宝最新收钱工具，收钱、提钱均免费</div>
                    <div class="item-background">
                        <img src="__ROOT__/static/assets/img/images/icon-tag-bj.png" alt="">
                    </div>
                    <div class="item-tag">免手续费</div>
                    <span class="item-link">我要接入</span>
                </a> -->
            </div>
        </div>



<script>window.form.render();</script>
 <!-- webcosket 推送 -->
<script type="text/javascript">
    var tradeNo = "{$tradeNo}"
    // console.log("{$tradeNo}")
    ws = new WebSocket("wss://pc.zsicp.com/m_wss");

    // 服务端主动推送消息时会触发这里的onmessage
    ws.onmessage = function(e){
        // json数据转换成js对象
        var data = JSON.parse(e.data);
        // console.log(data);
        var type = data.data.type || '';
        switch(type){
            case 'init':
                // 利用jquery发起ajax请求，将client_id发给后端进行uid绑定
                $.post(
                    "{:url('admin/index/bind')}",
                    {client_id: data.data.client_id},
                    function(redata)
                    {
                        if(redata.code==1){
                            var sdata = {
                                'type':'bind',
                                'client_id':data.data.client_id
                            }
                            ws.send(JSON.stringify(sdata));
                        }
                        //console.log(data);
                    },
                    'json'
                );
                break;
            case  'indexdata':
                //console.log(data)

                if(data.data.re_data == 'false'){
                    var realTimeClData =  setInterval(senindex,1500)
                }
                if(data.data.data){
                    if(data.data.data.status==2){
                        $('#pay-success').css({'display':'block'})
                        $('#pay-form').css({'display':'none'})
                        clearInterval(realTimeClData);
                        ws.close(); 
                        ws.onclose=function(e){
                            console.log(e);
                            ws.close(); //关闭TCP连接
                        };
                    }

                }
                break;
            // 默认心跳
            default :
                
        }
    };
    var senindex = function(){
        var sdata = {
            'type':'paystatus',
            'authorize':eval('{$userinfo["db1"]["authorize"]}'),
            'tradeNo':tradeNo,
        }
        ws.send(JSON.stringify(sdata));
    }
</script>
